package com.damei.qmui_test_demo.httpService;

import android.content.Context;

import com.damei.qmui_test_demo.model.LoginResponse;
import com.damei.qmui_test_demo.model.MeiZiResponse;

import java.util.HashMap;
import java.util.Map;

public class HttpManager {
    private volatile static HttpManager instance;

    private HttpManager(Context mContext) {
    }

    public static HttpManager getInstance(Context mContext) {
        if (instance == null) {
            synchronized (HttpManager.class) {
                if (instance == null) {
                    instance = new HttpManager(mContext);
                }
            }
        }
        return instance;
    }

    /**
     * 代理商手机号登录
     * @param param
     * @param handler
     */
    public void agentLoginByMobile(Map<String, String> param, HttpStringResponseHandler<LoginResponse> handler) {
        HttpService.getInstance().okgoFormPostRequest(HttpUrlConstants.AGENT_LOGIN_REQUEST, param, handler);
    }

    /**
     * 发送验证码
     * @param phone
     * @param handler
     */
   public void sendSmsNumberRequest(String phone, HttpStringResponseHandler<String> handler) {
       Map<String, String> param = new HashMap<String, String>();
       param.put("phone", phone);
       HttpService.getInstance().okgoFormPostRequest(HttpUrlConstants.SEND_SMSCODE_REQUEST, param, handler);
   }

}
